import { _decorator, AnimationClip,Animation, Component, Node, SpriteFrame } from 'cc';
import { FSM_PARAMS_TYPE_ENUM } from '../Enums';
import State from './State';
import { StateMachine } from './StateMachine';


const { ccclass, property } = _decorator;


export abstract class SubStateMachine {
  private _currentState:State = null
  stateMachine:Map<string,State> = new Map()
  constructor(public fsm:StateMachine){}

  //状态机的参数
  get currentState(){
    return this._currentState
  }
  //设置状态机的参数
  set currentState(newState){
    if(!newState){
      return
    }
    this._currentState = newState
    this._currentState.run()

  }

  abstract run() : void
}

